<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>我的博客 | zgj12306</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="hexo创建路径https:&#x2F;&#x2F;www.jianshu.com&#x2F;p&#x2F;189fd945f38fhexo命令路径hexo常用命令笔记https:&#x2F;&#x2F;segmentfault.com&#x2F;a&#x2F;1190000002632530 hexonpm install hexo -g #安装npm update hexo -g #升级hexo init #初始化简写hexo n “我的博客” &#x3D;&#x3D; hexo new “">
<meta property="og:type" content="article">
<meta property="og:title" content="我的博客">
<meta property="og:url" content="http://example.com/2021/03/31/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="zgj12306">
<meta property="og:description" content="hexo创建路径https:&#x2F;&#x2F;www.jianshu.com&#x2F;p&#x2F;189fd945f38fhexo命令路径hexo常用命令笔记https:&#x2F;&#x2F;segmentfault.com&#x2F;a&#x2F;1190000002632530 hexonpm install hexo -g #安装npm update hexo -g #升级hexo init #初始化简写hexo n “我的博客” &#x3D;&#x3D; hexo new “">
<meta property="og:locale">
<meta property="article:published_time" content="2021-03-31T10:47:11.000Z">
<meta property="article:modified_time" content="2021-03-31T10:55:33.701Z">
<meta property="article:author" content="zgj12306">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="zgj12306" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">zgj12306</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Suche"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Suche"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://example.com"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-我的博客" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2021/03/31/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time class="dt-published" datetime="2021-03-31T10:47:11.000Z" itemprop="datePublished">2021-03-31</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      我的博客
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p>hexo创建路径<br><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/189fd945f38f">https://www.jianshu.com/p/189fd945f38f</a><br>hexo命令路径<br>hexo常用命令笔记<br><a target="_blank" rel="noopener" href="https://segmentfault.com/a/1190000002632530">https://segmentfault.com/a/1190000002632530</a></p>
<p>hexo<br>npm install hexo -g #安装<br>npm update hexo -g #升级<br>hexo init #初始化<br>简写<br>hexo n “我的博客” == hexo new “我的博客” #新建文章<br>hexo p == hexo publish<br>hexo g == hexo generate#生成<br>hexo s == hexo server #启动服务预览<br>hexo d == hexo deploy#部署</p>
<p>服务器<br>hexo server #Hexo 会监视文件变动并自动更新，您无须重启服务器。<br>hexo server -s #静态模式<br>hexo server -p 5000 #更改端口<br>hexo server -i 192.168.1.1 #自定义 IP</p>
<p>hexo clean #清除缓存 网页正常情况下可以忽略此条命令<br>hexo g #生成静态网页<br>hexo d #开始部署</p>
<p>监视文件变动<br>hexo generate #使用 Hexo 生成静态文件快速而且简单<br>hexo generate –watch #监视文件变动</p>
<p>完成后部署<br>两个命令的作用是相同的<br>hexo generate –deploy<br>hexo deploy –generate</p>
<p>hexo deploy -g<br>hexo server -g</p>
<p>草稿<br>hexo publish [layout] <title></p>
<p>模版<br>hexo new “postName” #新建文章<br>hexo new page “pageName” #新建页面<br>hexo generate #生成静态页面至public目录<br>hexo server #开启预览访问端口（默认端口4000，’ctrl + c’关闭server）<br>hexo deploy #将.deploy目录部署到GitHub</p>
<p>hexo new [layout] <title><br>hexo new photo “My Gallery”<br>hexo new “Hello World” –lang tw</p>
<p>变量    描述<br>layout    布局<br>title    标题<br>date    文件建立日期<br>title: 使用Hexo搭建个人博客<br>layout: post<br>date: 2014-03-03 19:07:43<br>comments: true<br>categories: Blog<br>tags: [Hexo]<br>keywords: Hexo, Blog<br>description: 生命在于折腾，又把博客折腾到Hexo了。给Hexo点赞。<br>模版（Scaffold）<br>hexo new photo “My Gallery”</p>
<p>变量    描述<br>layout    布局<br>title    标题<br>date    文件建立日期<br>设置文章摘要<br>以上是文章摘要 <span id="more"></span> 以下是余下全文<br>写作<br>hexo new page <title><br>hexo new post <title></p>
<p>变量    描述<br>:title    标题<br>:year    建立的年份（4 位数）<br>:month    建立的月份（2 位数）<br>:i_month    建立的月份（去掉开头的零）<br>:day    建立的日期（2 位数）<br>:i_day    建立的日期（去掉开头的零）<br>推送到服务器上<br>hexo n #写文章<br>hexo g #生成<br>hexo d #部署 #可与hexo g合并为 hexo d -g</p>
<p>报错<br>1.找不到git部署<br>ERROR Deployer not found: git<br>解决方法</p>
<p>npm install hexo-deployer-git –save</p>
<p>3.部署类型设置git<br>hexo 3.0 部署类型不再是github，_config.yml 中修改</p>
<h1 id="Deployment"><a href="#Deployment" class="headerlink" title="Deployment"></a>Deployment</h1><h2 id="Docs-http-hexo-io-docs-deployment-html"><a href="#Docs-http-hexo-io-docs-deployment-html" class="headerlink" title="Docs: http://hexo.io/docs/deployment.html"></a>Docs: <a target="_blank" rel="noopener" href="http://hexo.io/docs/deployment.html">http://hexo.io/docs/deployment.html</a></h2><p>deploy:<br>  type: git<br>  repository: git@<em><strong>.github.com:</strong></em>/***.github.io.git<br>  branch: master<br>4. xcodebuild<br>xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance</p>
<p>npm install bcrypt</p>
<ol start="5">
<li>RSS不显示<br>安装RSS插件<br>npm install hexo-generator-feed –save</li>
</ol>
<p>开启RSS功能<br>编辑hexo/_config.yml，添加如下代码：</p>
<p>rss: /atom.xml #rss地址  默认即可<br>开启评论<br>1.我使用多说代替自带的评论，在多说 网站注册 &gt; 后台管理 &gt; 添加新站点 &gt; 工具 === 复制通用代码 里面有 short_name</p>
<p>在根目录 _config.yml 添加一行 disqus_shortname: jslite 是在多说注册时产生的</p>
<p>复制到 themes\landscape\layout_partial\article.ejs<br>把</p>
<p>&lt;% if (!index &amp;&amp; post.comments &amp;&amp; config.disqus_shortname){ %&gt;</p>
<section id="comments">
<div id="disqus_thread">
  <noscript>Please enable JavaScript to view the <a target="_blank" rel="noopener" href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</section>
<% } %>
改为

<p>&lt;% if (!index &amp;&amp; post.comments &amp;&amp; config.disqus_shortname){ %&gt;<br>  <section id="comments"><br>    <!-- 多说评论框 start --><br>    <div class="ds-thread" data-thread-key="<%= post.layout %>-<%= post.slug %>" data-title="<%= post.title %>" data-url="<%= page.permalink %>"></div><br>    <!-- 多说评论框 end --><br>    <!-- 多说公共JS代码 start (一个网页只需插入一次) --><br>    <script type="text/javascript"><br>    var duoshuoQuery = {short_name:'<%= config.disqus_shortname %>'};<br>      (function() {<br>        var ds = document.createElement('script');<br>        ds.type = 'text/javascript';ds.async = true;<br>        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';<br>        ds.charset = 'UTF-8';<br>        (document.getElementsByTagName('head')[0]<br>         || document.getElementsByTagName('body')[0]).appendChild(ds);<br>      })();<br>      </script><br>    <!-- 多说公共JS代码 end --><br>  </section><br>&lt;% } %&gt;<br>hexo</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://example.com/2021/03/31/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/" data-id="ckmxdo5m800014bkb0f3w129z" data-title="我的博客" class="article-share-link">Teilen</a>
      
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
  
    <a href="/1970/01/01/hello-world/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Älter</strong>
      <div class="article-nav-title">Hello World</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archiv</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/03/">March 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/1970/01/">January 1970</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">letzter Beitrag</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2021/03/31/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/">我的博客</a>
          </li>
        
          <li>
            <a href="/1970/01/01/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2021 zgj12306<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/js/jquery-3.4.1.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>